Skip to content

Fix Windows startup crash: permission IPC pipe path and null guard (#… - #462

Merged
parsakhaz merged 1 commit into
dcouple:mainfrom
ilijachrchev:fix/windows-permission-ipc-460
Aug 18, 2026
Merged

Fix Windows startup crash: permission IPC pipe path and null guard (#…#462
parsakhaz merged 1 commit into
dcouple:mainfrom
ilijachrchev:fix/windows-permission-ipc-460

Conversation

@ilijachrchev

Copy link
Copy Markdown
Contributor

Description

Fixes two bugs causing Pane to crash on startup on Windows (2.4.60 regression).

Closes #460.

Bug 1 — permissionIpcServer.ts uses a filesystem path for the socket on Windows.
On Windows, net.Server.listen(path) expects a named pipe (\\.\pipe\<name>), not a filesystem path. The existing code passes a path like C:\Users\<user>\.pane\sockets\pane-permissions-<pid>.sock, which fails with EACCES on every launch. Fixed by platform-branching the socket path to use a named pipe on Windows, and skipping the fs.existsSync/fs.unlinkSync socket cleanup since Windows named pipes are not filesystem entries.

Bug 2 — cliManagerFactory.ts null guard passes null into decodeBoundary.
When Bug 1 causes the permission IPC server to fail, permissionIpcPath stays null. The guard checks !== undefined, which passes null through to decodeBoundary, throwing input: expected string and crashing service initialization. Fixed by adding a !== null check to match the codebase's prevailing convention. (typeof === 'string' was the obvious fix but the repo's no-runtime-typeof oxlint rule blocks it.)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the CONTRIBUTING.md guidelines
  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have run pnpm typecheck and pnpm lint locally
  • I have tested the Electron app locally with pnpm electron-dev

Critical Areas Modified

  • State management/IPC events

Screenshots (if applicable)

Before fix (2.4.60 on Windows):

[Permission IPC] Server error: listen EACCES: permission denied C:\Users.pane\sockets\pane-permissions-.sock
[CliToolRegistry] Failed to create manager for tool 'claude': Error: input: expected string
UnhandledPromiseRejectionWarning: Error: Failed to create manager for CLI tool 'claude'

After fix:

[Main] Permission IPC server started successfully
[Main] Permission IPC socket path: .\pipe\pane-permissions-
[CliManagerFactory] Created claude manager successfully
[Main] Services initialized, creating window...
[Main] Window created successfully

Additional Notes

Two files changed, 8 insertions, 6 deletions. No new tests added — both fixes are guard/path changes in existing initialization code. The PaneDaemonServer in the same codebase already handles Windows named pipes correctly; permissionIpcServer was the one place that kept the Unix socket assumption.

Two files changed, 8 insertions, 6 deletions. No new tests added — both fixes are guard/path changes in existing initialization code. The PaneDaemonServer in the same codebase already handles Windows named pipes correctly; permissionIpcServer was the one place that kept the Unix socket assumption.

Note: When testing locally with npx electron . (running the main, frontend, and electron processes separately — pnpm run electron-dev doesn't work on Windows due to bash variable expansion in the script), the app initializes fully and reaches "Window created successfully" but the renderer shows a "Open Pane from the desktop app" fallback instead of the full UI. This happens on upstream/main without my changes as well — it appears to be a pre-existing dev environment issue where window.electronAPI is not injected in the dev build on Windows. The preload script exists at the expected path and the main process logs confirm all services initialize correctly. Flagging this in case others have a known workaround for local dev testing on Windows.

@parsakhaz

Copy link
Copy Markdown
Member

Maintainer validation on the exact patch: pnpm lint, pnpm typecheck, and the full main-process suite (63 files / 602 tests) pass. The reported Windows launch validation covers the platform-specific named-pipe path. Thank you for tracking this down and contributing the fix.

@parsakhaz
parsakhaz merged commit 0077ea7 into dcouple:main Aug 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: app fails to initialize on 2.4.60 — Failed to create manager for CLI tool 'claude': input: expected string

2 participants